using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using NHibernate.Mapping.Attributes;
using Lib;

namespace Persistance.Model
{
    [Serializable]
    [Class(Lazy = true)]
    public class Requests
    {

        private int _requestID;
        //NHIBER: Setts the primary key to ID
        [Id(Name = "RequestID")]
        [Generator(1, Class = "native")]
        public virtual int RequestID
        {
            get { return _requestID; }
            set { _requestID = value; }
        }

        ///<summary>
        ///Holds the user of each request
        ///</summary>
        private Items _item;
        [ManyToOne(Column = "ItemID", Cascade = CascadeStyle.All, Unique = true)]
        public virtual Items Item
        {
            get { return _item; }
            set { _item = value; }
        }

        private Users _originatingUser;
        [ManyToOne(Column = "UserID", Cascade = CascadeStyle.All, Unique = true)]
        public virtual Users OriginatingOwner
        {
            get { return _originatingUser; }
            set { _originatingUser = value; }
        }

    }
    
}
